home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / FWRegion.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.3 KB  |  104 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWRegion.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWREGION_H
  11. #define FWREGION_H
  12.  
  13. #ifndef FWGCONST_H
  14. #include "FWGConst.h"
  15. #endif
  16.  
  17. #ifndef SLREGION_H
  18. #include "SLRegion.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. //    Platform Region functions
  23. //========================================================================================
  24.  
  25. // ----- Equality -----
  26. FW_Boolean        FW_IsEqualRegion(ODRgnHandle rgn1, ODRgnHandle rgn2);
  27.  
  28. // ----- Region Operations -----
  29. void            FW_UnionRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn);
  30. void            FW_XorRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn);    // rgn1 - rgn2
  31. void            FW_SubtractRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn);
  32. void            FW_IntersectRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn);
  33.  
  34. //========================================================================================
  35. //    inlines
  36. //========================================================================================
  37.  
  38. //----------------------------------------------------------------------------------------
  39. //    FW_IsEqualRegion
  40. //----------------------------------------------------------------------------------------
  41.  
  42. inline FW_Boolean FW_IsEqualRegion(ODRgnHandle rgn1, ODRgnHandle rgn2)
  43. {
  44.     return ::EqualRgn(rgn1, rgn2);
  45. }
  46.  
  47. //----------------------------------------------------------------------------------------
  48. //    FW_UnionRegion
  49. //----------------------------------------------------------------------------------------
  50.  
  51. inline void FW_UnionRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn)
  52. {
  53. #ifdef FW_BUILD_MAC
  54.     ::UnionRgn(rgn1, rgn2, dstRgn);
  55. #endif
  56. #ifdef FW_BUILD_WIN
  57.     ::CombineRgn(dstRgn, rgn1, rgn2, RGN_OR);
  58. #endif
  59. }
  60.  
  61. //----------------------------------------------------------------------------------------
  62. //    FW_XorRegion
  63. //----------------------------------------------------------------------------------------
  64.  
  65. inline void FW_XorRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn)
  66. {
  67. #ifdef FW_BUILD_MAC
  68.     ::XorRgn(rgn1, rgn2, dstRgn);
  69. #endif
  70. #ifdef FW_BUILD_WIN
  71.     ::CombineRgn(dstRgn, rgn1, rgn2, RGN_XOR);
  72. #endif
  73. }
  74.  
  75. //----------------------------------------------------------------------------------------
  76. //    FW_SubtractRegion
  77. //----------------------------------------------------------------------------------------
  78.  
  79. inline void FW_SubtractRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn)
  80. {
  81. #ifdef FW_BUILD_MAC
  82.     ::DiffRgn(rgn1, rgn2, dstRgn);
  83. #endif
  84. #ifdef FW_BUILD_WIN
  85.     ::CombineRgn(dstRgn, rgn1, rgn2, RGN_DIFF);
  86. #endif
  87. }
  88.  
  89. //----------------------------------------------------------------------------------------
  90. //    FW_IntersectRegion
  91. //----------------------------------------------------------------------------------------
  92.  
  93. inline void FW_IntersectRegion(ODRgnHandle rgn1, ODRgnHandle rgn2, ODRgnHandle dstRgn)
  94. {
  95. #ifdef FW_BUILD_MAC
  96.     ::SectRgn(rgn1, rgn2, dstRgn);
  97. #endif
  98. #ifdef FW_BUILD_WIN
  99.     ::CombineRgn(dstRgn, rgn1, rgn2, RGN_AND);
  100. #endif
  101. }
  102.  
  103. #endif
  104.